import { planBussType,departList } from '@/utils/data'
import httpRequest from '@/utils/httpRequest'


let cusList = [], empList = []
export const getCustom = () => {
	httpRequest({
		url: httpRequest.adornUrl('/crm/base/cust/page'),
		method: 'get',
		params: httpRequest.adornParams(Object.assign({
			current: 1,
			size: 1000
		}, {}))
	}).then(({ data }) => {
		console.log('11:', 11);
		cusList.push(...data.obj.records);
		console.log('11:', cusList);
	})
}
export const getEmp = () => {
	httpRequest({
		url: httpRequest.adornUrl('/crm/base/emp/page'),
		method: 'get',
		params: httpRequest.adornParams(Object.assign({
			current: 1,
			size: 100
		}, {}))
	}).then(({ data }) => {
		empList.push(...data.obj.records);
	})
}
getCustom()
getEmp()
export const tableOption = {
	searchMenuSpan: 4,
	searchSpan: 4,
	columnBtn: false,
	border: true,
	index: true,
	indexLabel: '序号',
	stripe: true,
	menuAlign: 'center',
	align: 'center',
	addBtn: true,
	addRowBtn: false,
	editBtn: false,
	delBtn: false,
	menu: false,
	showSummary: true,
	menuWidth: 220,
	cellBtn: true,
	sumColumnList: [
		{ label: '合计:', name: 'custom', type: '' },
		{ name: "1", type: 'sum' },
		{ name: "2", type: 'sum' },
		{ name: "3", type: 'sum' },
		{ name: "4", type: 'sum' },
		{ name: "5", type: 'sum' },
		{ name: "6", type: 'sum' },
		{ name: "7", type: 'sum' },
		{ name: "8", type: 'sum' },
		{ name: "9", type: 'sum' },
		{ name: "10", type: 'sum' },
		{ name: "11", type: 'sum' },
		{ name: "12", type: 'sum' },
	],
	column: [
		{
			label: '客户',
			prop: 'custName',
			type: "select",
			multiple: false,
			width: 120,
			cell: true,
			props: {
				label: "custName",
				value: "custManId",

			},
			dicData: cusList
		},
		{
			label: '负责人',
			prop: 'deptEmpNo',
			cell: true,
			type: "select",
			props: {
				label: "empName",
				value: "empNo",

			},
			dicData: empList,
		},
		{
			label: '所属部门',
			prop: 'deptName',
			cell: true,
			type: "select",
			dicData: departList,
		},
		
		{
			label: '年度',
			prop: 'planYear',
			type: "year",
			width: 120,
			search: true,
			cell: true,
			  format: 'yyyy',
			  valueFormat: 'yyyy'
		},
		{
			label: '业务类型',
			prop: 'planBussType',
			type: "select",
			search: true,
			dicData: planBussType,
			cell: true,

		},
		{
			label: '年度应收款',
			prop: 'ndysk',
			addDisplay: false,
		},
		{
			label: '年度总计划金额',
			prop: 'planYearAmt',
			cell: true
		},
		{
			label: '年度实际金额',
			prop: 'ndsj',
			addDisplay: false,
		},
		{
			label: '计划达成率',
			prop: 'jhdcl',
			addDisplay: false,
		},
		{
			label: '1月',
			prop: 'month1Amt',
			placeholder: '请输入1月计划金额',
		},
		{
			label: '2月',
			prop: 'month2Amt',
			cell: true,
			placeholder: '请输入2月计划金额',
		},
		{
			label: '3月',
			prop: 'month3Amt',
			cell: true,
			placeholder: '请输入3月计划金额',
		},
		{
			label: '4月',
			prop: 'month4Amt',
			cell: true,
			placeholder: '请输入4月计划金额',
		},
		{
			label: '5月',
			prop: 'month5Amt',
			cell: true,
			placeholder: '请输入5月计划金额',
		},
		{
			label: '6月',
			prop: 'month6Amt',
			cell: true,
			placeholder: '请输入6月计划金额',
		},
		{
			label: '7月',
			prop: 'month7Amt',
			cell: true,
			placeholder: '请输入7月计划金额',
		},
		{
			label: '8月',
			prop: 'month8Amt',
			cell: true,
			placeholder: '请输入8月计划金额',
		},
		{
			label: '9月',
			prop: 'month9Amt',
			cell: true,
			placeholder: '请输入9月计划金额',
		},
		{
			label: '10月',
			prop: 'month10Amt',
			cell: true,
			placeholder: '请输入10月计划金额',
		},
		{
			label: '11月',
			prop: 'month11Amt',
			cell: true,
			placeholder: '请输入11月计划金额',
		},
		{
			label: '12月',
			prop: 'month12Amt',
			cell: true,
			placeholder: '请输入12月计划金额',
		},
	]
}
